"""
实战二：判断车牌归属地
"""
i = 1
going = True
plateNumber = ''
print('判断车牌归属地，输入q退出')
dictionary = {'津': '天津', '京': '北京', '沪': '上海', '辽': '辽宁'}
while going == True:
    plateNumber = input('第'+str(i)+'车牌号码是: ')
    if plateNumber == 'q' or len(plateNumber) == 1:
        going = False
    else:
        number = plateNumber[0]
        if dictionary.get(number):
            print('这张号牌的归属地: '+dictionary[number])
            i = i + 1
        else:
            print('车牌格式有误, 请重新输入')
